﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Atomic.User.Entities
{
    /// <summary>
    /// 用户基础信息，每个用户具备的一对一的特有属性信息
    /// </summary>
    public class UserBaseEntity
    {
        /// <summary>
        /// Password
        /// </summary>
        public const string PASSWORD = "Password";

        /// <summary>
        /// 主键
        /// </summary>
        public virtual int ID
        {
            get;
            set;
        }

        /// <summary>
        /// 用户类型ID（可自定义）
        /// </summary>
        public virtual int TypeID
        {
            get;
            set;
        }

        /// <summary>
        /// 登陆名（主键）
        /// </summary>
        [DisplayName("登录名")]
        [Required]
        [StringLength(50)]
        public virtual string LoginName { set; get; }
        /// <summary>
        /// 登陆密码
        /// </summary>
        [DisplayName("密码")]
        [Required]
        [StringLength(64)]
        public virtual string Password { set; get; }

        /// <summary>
        /// 昵称
        /// </summary>
        [DisplayName("昵称")]
        [StringLength(20)]
        [DefaultValue("")]
        public virtual string NickName
        {
            get;
            set;
        }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [DisplayName("姓名")]
        [StringLength(20)]
        [DefaultValue("")]
        public virtual string RealName
        {
            get;
            set;
        }

        /// <summary>
        /// 性别：1-男，2-女，0-未知
        /// </summary>
        [DisplayName("性别")]
        public virtual int Sex { set; get; }

        /// <summary>
        /// 生日，出生年月日。如：19880122
        /// </summary>
        [DisplayName("生日")]
        public virtual int Birthday { set; get; }

        /// <summary>
        /// 扩展用户详细信息（对应一张自定义用户类型关联的表字段名的字段值）
        /// </summary>
        public virtual List<KeyValuePair<string, object>> ExtendData
        {
            get;
            set;
        }

    }
}
